/**
 */
package org.mro.grib.model.files.secondEdition.products.meteorological.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.mro.grib.model.files.secondEdition.products.meteorological.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class MeteorologicalFactoryImpl extends EFactoryImpl implements MeteorologicalFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static MeteorologicalFactory init() {
		try {
			MeteorologicalFactory theMeteorologicalFactory = (MeteorologicalFactory)EPackage.Registry.INSTANCE.getEFactory(MeteorologicalPackage.eNS_URI);
			if (theMeteorologicalFactory != null) {
				return theMeteorologicalFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new MeteorologicalFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MeteorologicalFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case MeteorologicalPackage.TEMPERATURE_PRODUCTS:
				return createTemperatureProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.METEOROLOGICAL_PRODUCTS:
				return createMeteorologicalProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.MOISTURE_PRODUCTS:
				return createMoistureProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.MOMENTUM_PRODUCTS:
				return createMomentumProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.MASS_PRODUCTS:
				return createMassProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.SHORT_WAVE_RADIATION_PRODUCTS:
				return createShortWaveRadiationProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.LONG_WAVE_RADIATION_PRODUCTS:
				return createLongWaveRadiationProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.CLOUD_PRODUCTS:
				return createCloudProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.THERMODYNAMIC_STABILITY_INDICES_PRODUCTS:
				return createThermodynamicStabilityIndicesProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.AEROSOLS_PRODUCTS:
				return createAerosolsProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.TRACE_GASES_PRODUCTS:
				return createTraceGasesProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.RADAR_PRODUCTS:
				return createRadarProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.FORECAST_RADAR_IMAGERY_PRODUCTS:
				return createForecastRadarImageryProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.NUCLEAR_RADIOLOGY_PRODUCTS:
				return createNuclearRadiologyProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.PHYSICAL_ATMOSPHERIC_PROPERTIES_PRODUCTS:
				return createPhysicalAtmosphericPropertiesProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.ATMOSPHERIC_CHEMICAL_CONSTITUENTS_PRODUCTS:
				return createAtmosphericChemicalConstituentsProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.CCITTIA5_STRING_PRODUCTS:
				return createCCITTIA5StringProductsFromString(eDataType, initialValue);
			case MeteorologicalPackage.MISCELLANEOUS_PRODUCTS:
				return createMiscellaneousProductsFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case MeteorologicalPackage.TEMPERATURE_PRODUCTS:
				return convertTemperatureProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.METEOROLOGICAL_PRODUCTS:
				return convertMeteorologicalProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.MOISTURE_PRODUCTS:
				return convertMoistureProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.MOMENTUM_PRODUCTS:
				return convertMomentumProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.MASS_PRODUCTS:
				return convertMassProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.SHORT_WAVE_RADIATION_PRODUCTS:
				return convertShortWaveRadiationProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.LONG_WAVE_RADIATION_PRODUCTS:
				return convertLongWaveRadiationProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.CLOUD_PRODUCTS:
				return convertCloudProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.THERMODYNAMIC_STABILITY_INDICES_PRODUCTS:
				return convertThermodynamicStabilityIndicesProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.AEROSOLS_PRODUCTS:
				return convertAerosolsProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.TRACE_GASES_PRODUCTS:
				return convertTraceGasesProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.RADAR_PRODUCTS:
				return convertRadarProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.FORECAST_RADAR_IMAGERY_PRODUCTS:
				return convertForecastRadarImageryProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.NUCLEAR_RADIOLOGY_PRODUCTS:
				return convertNuclearRadiologyProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.PHYSICAL_ATMOSPHERIC_PROPERTIES_PRODUCTS:
				return convertPhysicalAtmosphericPropertiesProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.ATMOSPHERIC_CHEMICAL_CONSTITUENTS_PRODUCTS:
				return convertAtmosphericChemicalConstituentsProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.CCITTIA5_STRING_PRODUCTS:
				return convertCCITTIA5StringProductsToString(eDataType, instanceValue);
			case MeteorologicalPackage.MISCELLANEOUS_PRODUCTS:
				return convertMiscellaneousProductsToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TemperatureProducts createTemperatureProductsFromString(EDataType eDataType, String initialValue) {
		TemperatureProducts result = TemperatureProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertTemperatureProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MeteorologicalProducts createMeteorologicalProductsFromString(EDataType eDataType, String initialValue) {
		MeteorologicalProducts result = MeteorologicalProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertMeteorologicalProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MoistureProducts createMoistureProductsFromString(EDataType eDataType, String initialValue) {
		MoistureProducts result = MoistureProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertMoistureProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MomentumProducts createMomentumProductsFromString(EDataType eDataType, String initialValue) {
		MomentumProducts result = MomentumProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertMomentumProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MassProducts createMassProductsFromString(EDataType eDataType, String initialValue) {
		MassProducts result = MassProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertMassProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ShortWaveRadiationProducts createShortWaveRadiationProductsFromString(EDataType eDataType, String initialValue) {
		ShortWaveRadiationProducts result = ShortWaveRadiationProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertShortWaveRadiationProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LongWaveRadiationProducts createLongWaveRadiationProductsFromString(EDataType eDataType, String initialValue) {
		LongWaveRadiationProducts result = LongWaveRadiationProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertLongWaveRadiationProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CloudProducts createCloudProductsFromString(EDataType eDataType, String initialValue) {
		CloudProducts result = CloudProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertCloudProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ThermodynamicStabilityIndicesProducts createThermodynamicStabilityIndicesProductsFromString(EDataType eDataType, String initialValue) {
		ThermodynamicStabilityIndicesProducts result = ThermodynamicStabilityIndicesProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertThermodynamicStabilityIndicesProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AerosolsProducts createAerosolsProductsFromString(EDataType eDataType, String initialValue) {
		AerosolsProducts result = AerosolsProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertAerosolsProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TraceGasesProducts createTraceGasesProductsFromString(EDataType eDataType, String initialValue) {
		TraceGasesProducts result = TraceGasesProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertTraceGasesProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RadarProducts createRadarProductsFromString(EDataType eDataType, String initialValue) {
		RadarProducts result = RadarProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertRadarProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ForecastRadarImageryProducts createForecastRadarImageryProductsFromString(EDataType eDataType, String initialValue) {
		ForecastRadarImageryProducts result = ForecastRadarImageryProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertForecastRadarImageryProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NuclearRadiologyProducts createNuclearRadiologyProductsFromString(EDataType eDataType, String initialValue) {
		NuclearRadiologyProducts result = NuclearRadiologyProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertNuclearRadiologyProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PhysicalAtmosphericPropertiesProducts createPhysicalAtmosphericPropertiesProductsFromString(EDataType eDataType, String initialValue) {
		PhysicalAtmosphericPropertiesProducts result = PhysicalAtmosphericPropertiesProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertPhysicalAtmosphericPropertiesProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AtmosphericChemicalConstituentsProducts createAtmosphericChemicalConstituentsProductsFromString(EDataType eDataType, String initialValue) {
		AtmosphericChemicalConstituentsProducts result = AtmosphericChemicalConstituentsProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertAtmosphericChemicalConstituentsProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CCITTIA5StringProducts createCCITTIA5StringProductsFromString(EDataType eDataType, String initialValue) {
		CCITTIA5StringProducts result = CCITTIA5StringProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertCCITTIA5StringProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MiscellaneousProducts createMiscellaneousProductsFromString(EDataType eDataType, String initialValue) {
		MiscellaneousProducts result = MiscellaneousProducts.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertMiscellaneousProductsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MeteorologicalPackage getMeteorologicalPackage() {
		return (MeteorologicalPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static MeteorologicalPackage getPackage() {
		return MeteorologicalPackage.eINSTANCE;
	}

} //MeteorologicalFactoryImpl
